#include <stdio.h>
 
#define MAX_ROW 10
#define MAX_COL 10
 
int main(int argc, char *argv[])
{
 
    int dwRow = 0, dwCol = 0, aTriVal[MAX_ROW][MAX_COL] = {{0}};
 
    for (dwRow = 0; dwRow < MAX_ROW; dwRow++)
    {
        aTriVal[dwRow][0] = aTriVal[dwRow][dwRow] = 1; //若为i行0或i列，则i行j列杨辉值为1
    }
 
    for (dwRow = 2; dwRow < MAX_ROW; dwRow++)
    {
        for (dwCol = 1; dwCol < dwRow; dwCol++) //否则，i行j列杨辉值为i-1行中第j-1列与第j列值之和
            aTriVal[dwRow][dwCol] = aTriVal[dwRow - 1][dwCol - 1] + aTriVal[dwRow - 1][dwCol];
    }
 
    int n=0;
 
    scanf("%d", &n);
 
    //输出杨辉三角值
    for (dwRow = 0; dwRow < n; dwRow++)
    {
        for (dwCol = 0; dwCol <= dwRow; dwCol++)
        {
            printf("%-8d", aTriVal[dwRow][dwCol]);
        }
        printf("\n");
    }
 
    return 0;
}